#include <vector>
#include <set>
#include <iostream>
#include <unordered_map>
#include <numeric>

using namespace std;

bool canConstruct(string ransomNote, string magazine) {
    vector<int> num(122-97+1, 0);
    for(int i = 0; i < magazine.size(); i++){
        num[int(magazine[i])-97]++;
    }
    for(int i = 0; i < ransomNote.size(); i++){
        if(--num[int(ransomNote[i])-97] == -1){
            return false;
        }
    }
    return true;
}

int main(){
    string ransomNote = "a", magazine = "b";
    cout << canConstruct(ransomNote, magazine) << endl;
    return 0;
}